package models

import (
	"time"

	"github.com/beego/beego/v2/client/orm"
)

type ShortUrl struct {
	Id        uint64    `orm:"pk;auto;column(id)"`
	Code      string    `orm:"unique;column(code)"`
	Url       string    `orm:"type(text);column(url)"`
	CreatedAt time.Time `orm:"auto_now_add;column(create_time)"`
}

func (s *ShortUrl) TableEngine() string {
	return "INNODB"
}

func init() {
	orm.RegisterModelWithPrefix("dwz_", new(ShortUrl))
}
